package com.yequan.work;

import java.util.Map;
import java.util.Objects;

/**
 * @author yequan
 * @date 2021/08/02 18:10
 **/
public class CastDemo {

    public static void main(String[] args) {
        insertOrUpdateRideInfoExtra(0L, 0L);
    }

    public static void insertOrUpdateRideInfoExtra(long usualRouteId, long temporaryRouteId) {
        if (usualRouteId == 0 && temporaryRouteId == 0) {
            String extra = "{\"usual_route_id\":25599105}";
            Map<String, Object> map = JsonMapper.json2Map(extra);
            usualRouteId = Objects.nonNull(map.get("usual_route_id")) ? Long.parseLong(String.valueOf(map.get("usual_route_id"))) : 0;
            temporaryRouteId = Objects.nonNull(map.get("temporary_route_id")) ? Long.parseLong(String.valueOf(map.get("temporary_route_id"))) : 0;
            System.out.println(usualRouteId);
            System.out.println(temporaryRouteId);
        }
    }
}
